﻿@using TinyMoocSite.ViewModels
@model AddResourceForm

@{
    ViewBag.Title = "添加课程资源";
    Layout = "~/Views/Teacher/CoursePageLayout.cshtml";
}

@section Resource { active }

@section RightContainer
{
    <h4>课程资源&raquo;上传一个文件</h4><hr />
    <form role="form" action="/Teacher/DoAddResource" method="post" enctype="multipart/form-data" class="update-form form-horizontal">
        <input type="hidden" name="Id" class="form-control" id="form-id" value="@Model.Id">

        <div class="form-group">
            <label for="form-name" class="col-sm-2 control-label">文件名称</label>
            <div class="col-sm-10">
                <input type="text" name="Name" class="form-control" id="form-name" >
            </div>
        </div>

        <div class="form-group">
            <label for="form-filetype" class="col-sm-2 control-label">文件类型</label>
            <div class="col-sm-10">
                <input type="text" name="FileType" class="form-control" id="form-filetype" list="filetype-list" >
            </div>
        </div>

        <div class="form-group">
            <label for="form-fileclass" class="col-sm-2 control-label">所属分区</label>
            <div class="col-sm-10">
                <input type="text" name="Class" class="form-control" id="form-fileclass" list="fileclass-list">
            </div>
        </div>

        <div class="form-group">
            <label for="form-file" class="col-sm-2 control-label">选择文件</label>
            <div class="col-sm-10">
                <input type="file" name="FileObject" class="form-control" id="form-file">
            </div>
        </div>

        <br /><br />
        <div class="text-center">
            <button type="submit" class="btn btn-default">上传</button>
            &nbsp;&nbsp;
            <button type="button" class="btn btn-default" onclick="history.back();">返回</button>
        </div>
        <br /><br />
    </form>

    <datalist id="filetype-list">
        <option value="课件" />
        <option value="作业" />
        <option value="音视频" />
        <option value="其它资料" />
    </datalist>

    <datalist id="fileclass-list">
        @foreach (string item in Model.ClassList)
        {
            <option value="@item" />
        }
    </datalist>
}
